UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FHAKGyM66uUfA4MgKcafMpAPn/bxx0+GLyO+zDbbTuE=' 
WHERE 
  key_id = '8feba4e47954ba49a6d5c04056040dd51dc3837135c7e3c03cc8359957fdfe97' 
  AND (
    token = 'FHAKGyM66uUfA4MgKcafMpAPn/bxx0+GLyO+zDbbTuE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037