UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wWYk+ll6Ig5Oxj2Lrpm6PJNWZaT7Q1IOsbCuza40tkI='
WHERE
key_id = '5ce295b7a7dc3cda3ec92a2ea728d5518d782b1320028dd453dc3bf921914dac'
AND (
token = 'wWYk+ll6Ig5Oxj2Lrpm6PJNWZaT7Q1IOsbCuza40tkI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)