UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0NtOpaybo9nj7mHqIjpMHo5ZwJgCtfUt6qeAqUDxgFI='
WHERE
key_id = 'b1a525429e22f7aa88182bb9dbd022e19da8d74cfba170fd5982dd3cbdea40c9'
AND (
token = '0NtOpaybo9nj7mHqIjpMHo5ZwJgCtfUt6qeAqUDxgFI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)