UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '11eehtBu8CPvJnpLYlVhlS3drkz5dZKedX463ALolb0='
WHERE
key_id = '079a13b08e828e25f71cdb9a75f3c9bc74b96d71dfced8a447e6ac34955e554a'
AND (
token = '11eehtBu8CPvJnpLYlVhlS3drkz5dZKedX463ALolb0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)