UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'v+nKw4CrdyhWOxM3lLXD3zj2OCtUbAUrG6YRr0maP/s='
WHERE
key_id = '25cd473dbcff869c9773aa7b8baca1d35f6d8ed734b0a09453014febd87b7935'
AND (
token = 'v+nKw4CrdyhWOxM3lLXD3zj2OCtUbAUrG6YRr0maP/s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)