UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WT74lFxGtoOl3P3zFWRJus9cHEZSTknafUM9cZWvMRk='
WHERE
key_id = '117028505c07c95d8fb8d15c78a114cc23541ac8e86e251fc1db76ac30fd39cb'
AND (
token = 'WT74lFxGtoOl3P3zFWRJus9cHEZSTknafUM9cZWvMRk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)