UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'J3kbihgH1FfZFaUr0d1aVdPTaaAMmQpSc73/fafe96g=' 
WHERE 
  key_id = '6432af3d6c736d0c3ee9e5b2eed04f8102023c8dc4b92784087cf053eca4f274' 
  AND (
    token = 'J3kbihgH1FfZFaUr0d1aVdPTaaAMmQpSc73/fafe96g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021