UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fbUllUEFsID+JDnH0f0rGXs7dWUc1ZKnNP2KU/QYvd4=' 
WHERE 
  key_id = 'd111528c6ee7bebdb60a7d5e317b4bf31b43629ef1e834870f79e51d58736ba2' 
  AND (
    token = 'fbUllUEFsID+JDnH0f0rGXs7dWUc1ZKnNP2KU/QYvd4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037