UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lNp0h5uyxQ/7J9JHCwAqLJh9VennR5n4hFGObYfdvCk='
WHERE
key_id = '60818c42365e78ee60f41357ae1dc82f97543e838e2aeee3b5016dfee8b79139'
AND (
token = 'lNp0h5uyxQ/7J9JHCwAqLJh9VennR5n4hFGObYfdvCk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)