UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UEKoP/2nAIpeOtE5mcFEN48kgWwxQlKqAHXRG8TBPTY='
WHERE
key_id = '3e666bdc0a1129216e8603a9bf0236dc0733c0375fa820d65971815e3e8e0728'
AND (
token = 'UEKoP/2nAIpeOtE5mcFEN48kgWwxQlKqAHXRG8TBPTY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)