UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gOXC1C/aZxPXnqaK81Q0EIVFBWsnOCV3MibpZit1YwA=' 
WHERE 
  key_id = '9c43cfed65a514298617a3574bbeaa8edba9de20a4e3ce3cee999e47685e0fde' 
  AND (
    token = 'gOXC1C/aZxPXnqaK81Q0EIVFBWsnOCV3MibpZit1YwA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029