UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XZeEE435mnLQ/Ajf9u4Wr9vpjbl4MP4Z0pKSANEqrLM='
WHERE
key_id = 'e702e45a753da2a5f77d22cd5383772593371c16f91701f2e8eb5c01ccd4530f'
AND (
token = 'XZeEE435mnLQ/Ajf9u4Wr9vpjbl4MP4Z0pKSANEqrLM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)