UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '214pWk280mktduzQtEiTlwBBmTdzBoNBZVvpmRE6HtQ='
WHERE
key_id = '630af605ed2b2f495b24fb300e108ff4c587efaeb5e9138e7497a3a09d46d06c'
AND (
token = '214pWk280mktduzQtEiTlwBBmTdzBoNBZVvpmRE6HtQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)