UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5LqKUw29JcEZ2DDQFRMp4KuuGB/oGcrDemLrNKjsZpo='
WHERE
key_id = '1d502c9edd0763554eecd8fc090a6e748c5224fe8cdc880d47b23c97d70b87f4'
AND (
token = '5LqKUw29JcEZ2DDQFRMp4KuuGB/oGcrDemLrNKjsZpo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)