UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'B0Z2RewCs04WA5DBVdFisv5bpKaeCC9faOIvuesjkwU=' 
WHERE 
  key_id = '63c776c304125886b4c817fa579edba401bc0b9b76caa726beacb0fea9feb954' 
  AND (
    token = 'B0Z2RewCs04WA5DBVdFisv5bpKaeCC9faOIvuesjkwU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019