UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2xahPggARmrxrptRl2HSq81tn9ZX+jIU790osiUz7fQ='
WHERE
key_id = '0242120102531ad86c30cb1cb578ba699ce4877dbfab56db95ff3f98ede6c283'
AND (
token = '2xahPggARmrxrptRl2HSq81tn9ZX+jIU790osiUz7fQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)