UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tdKUW71919ele+T0sSohKYX31003XnS+5aR6c3tPDLU=' 
WHERE 
  key_id = '185f36794873d01650c53be882efcf6a698bc9c150248089be6902f28c5f4bc1' 
  AND (
    token = 'tdKUW71919ele+T0sSohKYX31003XnS+5aR6c3tPDLU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029