UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4qLBrm/7tJm1yQZ4wUquVha7PZ1yOO1umXRecGNog4U='
WHERE
key_id = 'bc568db837a8de0dd91f143259848abfefccb67abb78d1dc92383fd4939b305b'
AND (
token = '4qLBrm/7tJm1yQZ4wUquVha7PZ1yOO1umXRecGNog4U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)