UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2Dna2xFRJD/3x+KcIRbjzGrhTjSWMhxK0hz3hIg1DVk='
WHERE
key_id = '3c6b32c44b2be2deac8e867b74b926671a3bdbcc11e7010fb4c9b9314f720ec0'
AND (
token = '2Dna2xFRJD/3x+KcIRbjzGrhTjSWMhxK0hz3hIg1DVk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)