UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XKjyVfEpj88MYtKBZXi2bBCXUTQKsQjmp25qBiUneiY='
WHERE
key_id = 'd12ee439b8edf3388eb79ef62436f7047de27a8ee77e613ac001f9ac4c7ec49a'
AND (
token = 'XKjyVfEpj88MYtKBZXi2bBCXUTQKsQjmp25qBiUneiY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)