UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'E/xhy3JalUd4JoK5euVylX3T9ReIr8sB0/Bn+X7kPFc=' 
WHERE 
  key_id = 'ec6e6454f463bf851a551d8cf63e4d58bef71422e7aa8a4acdcad13f20964f2e' 
  AND (
    token = 'E/xhy3JalUd4JoK5euVylX3T9ReIr8sB0/Bn+X7kPFc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00061