UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yEQDhxIrWBSgs1iMwNQA66hoD8WJ2pD3pUVuwfFdPb0='
WHERE
key_id = '57083b55f7aea7d4e17aae2360d6e963561186ca3062924ec200000a2324c70e'
AND (
token = 'yEQDhxIrWBSgs1iMwNQA66hoD8WJ2pD3pUVuwfFdPb0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)