UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UOoEialDZr/crrrD+tcRB3JFL/b/JDUUed4cNKfYJEg=' 
WHERE 
  key_id = '4bfc5bea00d17b0aec03813e39d6b84f115c98987fed7f49783013b45c5c8e7b' 
  AND (
    token = 'UOoEialDZr/crrrD+tcRB3JFL/b/JDUUed4cNKfYJEg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029