UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tcYA2dROkV6GqC89yxSSO4PL+WKtJYp907cAVcjelzM='
WHERE
key_id = 'efb6790c04c1930f52829f3cebaa079c912ed190a14785fa9fb62f8b63255d9b'
AND (
token = 'tcYA2dROkV6GqC89yxSSO4PL+WKtJYp907cAVcjelzM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)