UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'iplOWT4aaT/ONPnvobIy4KBAIj0Q1RZytU0KzehqRvw=' 
WHERE 
  key_id = 'e79471b78560b81e9c7bbe0dde31473ef62266262842aeda719edb7e0348b59d' 
  AND (
    token = 'iplOWT4aaT/ONPnvobIy4KBAIj0Q1RZytU0KzehqRvw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037