UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Jj71fI074RUm0fXBMXXklax+gEVvjO88IHbGtyx+MoA=' 
WHERE 
  key_id = 'fdc68ae593aae27e01ab8976c2006d6bd5634529b0ec010fd2e1960cb51d72f7' 
  AND (
    token = 'Jj71fI074RUm0fXBMXXklax+gEVvjO88IHbGtyx+MoA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00063