UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5xiRTahicxTLeZrzf4x31G9/3ta/I4PKq1E2AxFVspg=' 
WHERE 
  key_id = '5cb53afec5b3f5fb65370421633ea94a13c46f1e4850c687614f81fe7cba5999' 
  AND (
    token = '5xiRTahicxTLeZrzf4x31G9/3ta/I4PKq1E2AxFVspg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039