UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wYm+uInliBLq2HJ/64pWAaNYhdjBDvsgZwR76VvfoZE=' 
WHERE 
  key_id = '65294ba6354624c213d4e2c321ac48d6f54db5d92a02181e44ec92218b8cefa4' 
  AND (
    token = 'wYm+uInliBLq2HJ/64pWAaNYhdjBDvsgZwR76VvfoZE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041