UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'b8g/uSH+kPop3ekmFI6AEpr8nqTC15TsjqMP77BRYKQ=' 
WHERE 
  key_id = '8e6f0b5019ee292fa483ec4927154acfc550caa8bee011f80e726d9f669209fd' 
  AND (
    token = 'b8g/uSH+kPop3ekmFI6AEpr8nqTC15TsjqMP77BRYKQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035